
local totalLength = achievements.GetValue( "The Proclaimers", "total", 0 )
local length = 31680000 // One mile.
if ( totalLength != length ) then
	local lastPos
	local function Update()
		local ply = LocalPlayer()
		if ( !ValidEntity( ply ) ) then return end
		if ( !ply:IsOnGround() ) then return end
		
		local pos = ply:GetPos()
		totalLength = math.min( totalLength + ( pos - ( lastPos or pos ) ):Length(), length )
		lastPos = pos
		
		local show = math.floor( totalLength )
		achievements.Update( "The Proclaimers", show / length, show .. "/" .. length )
		achievements.SetValue( "The Proclaimers", "total", show )
		
		if ( totalLength == length ) then
			timer.Destroy( "Achievements.Proclaimers" )
		end
	end
	timer.Create( "Achievements.Proclaimers", 0.1, 0, Update )
end

achievements.Register(
	"The Proclaimers", "Walk 31680000 inches.", "achievements/proclaimers",
	totalLength / length, totalLength .. "/" .. length
)